package com.oracle.news.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.oracle.mapper.CategoryMapper;
import com.oracle.news.service.api.NewsCategoryServiceApi;
import com.oracle.pojo.Category;
import com.oracle.vo.ResultEntity;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
public class NewsCategoryServiceImpl implements NewsCategoryServiceApi {

    @Autowired
    private CategoryMapper categoryMapper;

    @Override
    public ResultEntity<List<Category>> getNewsCategoryAll() {
        List<Category> categoryList = this.categoryMapper.selectByExample(null);
        return new ResultEntity<List<Category>>(ResultEntity.CODE_SUCCESS,ResultEntity.MSG_SUCCESS,categoryList);
    }
}
